<?php
defined('IN_IA') or exit('Access Denied');
global $_GPC, $_W;
$uniacid = $_W['uniacid'];
$setting = $this->baseset($uniacid);
$vosec = $setting['vosec'];
$op = $_GPC['op'];
if ($_W['ispost']) {
	$vofans = pdo_fetch("SELECT * FROM " . tablename($this->tablevolist) . " order by rand() LIMIT 1");
	$voitem = pdo_fetch("SELECT id,itemfee,itemfee2,itempic FROM " . tablename($this->tableitemall) . " where status=1 order by rand() LIMIT 1");
	$itemfee = $voitem['itemfee'] - $voitem['itemfee2'];
	$maxsec = empty($vosec) ? 15 : intval($vosec);
	$randsec = rand(1, $maxsec);
	exit(json_encode(array('username' => $vofans['username'], 'avatar' => $vofans['avatar'], 'rand' => $randsec, 'itemid' => $voitem['id'], 'fee' => $itemfee, 'itempic' => $voitem['itempic'] . "_50x50.jpg")));
}